package com.nuanshui.heatedloan.web.appuser;

import com.alibaba.dubbo.config.annotation.Reference;
import com.nuanshui.heatedloan.constant.GlobalParam;
import com.nuanshui.heatedloan.userinfo.facade.UserQueryService;
import com.nuanshui.heatedloan.userinfo.vo.UserVo;
import com.nuanshui.heatedloan.web.ApiController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * app用户的controller
 * @author Gonzo
 * @date 2016年12月22日
 */

@RestController
@RequestMapping("/cms/manage/appUser")
public class AppUserController extends ApiController{
	
	
	@Reference(url=GlobalParam.USER_DUBBO_SERVER,timeout=GlobalParam.DUBBO_SERVER_TIME_OUT,version = GlobalParam.USER_DUBBO_SERVER_VERSION)
	private UserQueryService userQueryService;
	
	@RequestMapping("/findByName")
	public String findByName(String userName){
		List<UserVo> users = userQueryService.findListByName(userName);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", users);
		return success(map);
	}
	
	
}
